#include <stdio.h>

using namespace std;

#define MAXN (100000 + 5)

typedef long long ll;

int N;
ll S;
ll W[MAXN];

void Read() {
  scanf("%d%lld", &N, &S);
  for (int i = 0; i < N; ++i) {
    scanf("%lld", &W[i]);
  }
}

void FindLongest(int from, int& len) {
  ll sum = 0;
  for (int i = from; i < N; ++i) {
    if (W[i] + sum > S) {
      len = i - from;
      return;
    }
    sum += W[i];
  }
}

void Solve() {
  int from = 0;
  int ans = 0;

  while (from < N) {
    int len = 0;
    FindLongest(from, len);
    printf("len %d\n", len);
    if (len) {
      from += len;
    } else {
      ++from;
    }
    len /= 2;
    if (len > ans) {
      ans = len;
    }
  }
  printf("%d\n", ans);
}

int main() {
  freopen("in.txt", "r", stdin);
  printf("Freop\n");
  Read();
  printf("Read\n");
  Solve();
  return 0;
}